# Created with pycharm
# author:ju bai
# Date:2021/7/20
# Time:10:20
from selenium import webdriver
import time
import os
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Chrome()
# 本地HTML
url = "file:///"+os.path.abspath("D:/Python/selenium2html/level_locate.html")
driver.get(url)
driver.maximize_window()
time.sleep(3)
# 层级定位
driver.find_element_by_link_text("Link1").click()
a = driver.find_element_by_link_text("Another action")
ActionChains(driver).move_to_element(a).perform()

time.sleep(6)
driver.quit()
